package com.code.day17;

import java.util.function.Supplier;

public class Demo11Stream {
    public static void main(String[] args) {
//        method(new Supplier<Double>() {
//            @Override
//            public Double get() {
//                return Math.random();
//            }
//        });
        method(Math::random);
    }
    public static void method(Supplier<Double> supplier){
        double number= supplier.get();
        System.out.println("number:"+number);
    }
}
